Skip to content

Add sample config files and load tests #9 #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
32 commits merged into from
Jul 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4473b3a
DG-377 (#2)
Apr 25, 2018
e22f9f3
save
May 2, 2018
b45072f
Adding support for code branches
May 14, 2018
1c9e6e3
Merge pull request #3 from dispatchlabs/DG-364
May 14, 2018
51d1468
Add build per branch
May 16, 2018
a853688
Simple contract and tests to debug storage
Jun 1, 2018
676c7e6
Add multiple params support
Jun 1, 2018
84186a3
update tests
Jun 4, 2018
bbf50b8
Update the ABI
Jun 4, 2018
3ff32f2
Remove ETHEREUM Aaccount, use from Common
Jun 4, 2018
0838c39
Remove ETHEREUM Aaccount, use from Common
Jun 4, 2018
5159aed
Add state restore support
Jun 4, 2018
dd3424e
some fixes
Jun 4, 2018
1afa275
Test Net 2.0 is Ready !
Jun 6, 2018
25bd2e8
Update DVM Result with execution context
Jun 6, 2018
debe71d
Fix the Nonce
Jun 7, 2018
74b7edf
update to script and updated to new configuration
Jun 11, 2018
3db1732
Merge remote-tracking branch 'origin/DG-484' into DG-484
Jun 11, 2018
7cbef12
Helpers to generate new TXes
Jun 11, 2018
e68b200
small updates to launch file
Jun 13, 2018
ec90c28
update for delegateNode
Jun 13, 2018
d7073a1
update spawn scripts
Jun 13, 2018
e2ae40b
Fix the path for go get
Jun 13, 2018
7f72788
Fix the genesis for seed
Jun 13, 2018
7e258a7
Merge pull request #4 from dispatchlabs/DG-484
restevens402 Jun 13, 2018
59e5455
Bubbling up the out of gas error and allow reasonable gas limit
Jun 19, 2018
427befc
Merge pull request #5 from dispatchlabs/DG-549
restevens402 Jun 19, 2018
38ae5d8
Update script (#6)
Jun 19, 2018
ccc0c40
Fix the coneciton pool issue and node configs (#8)
Jul 4, 2018
66a833a
Add sample config files and load tests (#9)
Jul 9, 2018
418038a
Add sample config files and load tests #9 (#10)
Jul 9, 2018
b7daa92
Merge branch 'master' into dev
Jul 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions google-cloud-spawn-vms/get-config-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

gcloud compute scp test-net-2-0-3-seed-0:/go-binaries/config/config.json ./seed-0.json
gcloud compute scp test-net-2-0-3-delegate-0:/go-binaries/config/config.json ./delegate-0.json
gcloud compute scp test-net-2-0-3-delegate-1:/go-binaries/config/config.json ./delegate-1.json
gcloud compute scp test-net-2-0-3-delegate-2:/go-binaries/config/config.json ./delegate-2.json
gcloud compute scp test-net-2-0-3-delegate-3:/go-binaries/config/config.json ./delegate-3.json
gcloud compute scp test-net-2-0-3-delegate-4:/go-binaries/config/config.json ./delegate-4.json
7 changes: 7 additions & 0 deletions google-cloud-spawn-vms/put-config-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

gcloud compute scp ./seed-0.json test-net-2-0-3-seed-0:~/config.json
gcloud compute scp ./delegate-0.json test-net-2-0-3-delegate-0:~/config.json
gcloud compute scp ./delegate-1.json test-net-2-0-3-delegate-1:~/config.json
gcloud compute scp ./delegate-2.json test-net-2-0-3-delegate-2:~/config.json
gcloud compute scp ./delegate-3.json test-net-2-0-3-delegate-3:~/config.json
gcloud compute scp ./delegate-4.json test-net-2-0-3-delegate-4:~/config.json
12 changes: 6 additions & 6 deletions google-cloud-spawn-vms/spawn-nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ type VMsConfig struct {

func main() {
var seedsCount = 1
var delegatesCount = 2
var nodesCount = 2
var namePrefix = "test-nicolae-debug"
var delegatesCount = 5
var nodesCount = 0
var namePrefix = "test-net-2-0-3"

// Create SEEDs
createVMs(
seedsCount,
VMsConfig{
ImageProject: "debian-cloud",
ImageFamily: "debian-9",
MachineType: "f1-micro",
MachineType: "n1-standard-2",
Tags: "disgo-node",
NamePrefix: namePrefix + "-seed",
ScriptConfigURL: "https://raw.githubusercontent.com/dispatchlabs/samples/dev/google-cloud-spawn-vms",
Expand All @@ -64,7 +64,7 @@ func main() {
VMsConfig{
ImageProject: "debian-cloud",
ImageFamily: "debian-9",
MachineType: "f1-micro",
MachineType: "n1-standard-2",
Tags: "disgo-node",
NamePrefix: namePrefix + "-delegate",
ScriptConfigURL: "https://raw.githubusercontent.com/dispatchlabs/samples/dev/google-cloud-spawn-vms",
Expand All @@ -90,7 +90,7 @@ func main() {
VMsConfig{
ImageProject: "debian-cloud",
ImageFamily: "debian-9",
MachineType: "f1-micro",
MachineType: "n1-standard-2",
Tags: "disgo-node",
NamePrefix: namePrefix + "-node",
ScriptConfigURL: "https://raw.githubusercontent.com/dispatchlabs/samples/dev/google-cloud-spawn-vms",
Expand Down
1 change: 1 addition & 0 deletions google-cloud-spawn-vms/tn-203/delegate-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"httpEndpoint":{"host":"0.0.0.0","port":1975},"grpcEndpoint":{"host":"35.199.177.99","port":1973},"grpcTimeout":5,"seedEndpoints":[{"host":"35.185.222.198","port":1973}],"delegateEndpoints":[{"host":"35.199.177.99","port":1973}],"useQuantumEntropy":false,"genesisTransaction":"{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"}
1 change: 1 addition & 0 deletions google-cloud-spawn-vms/tn-203/delegate-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"httpEndpoint":{"host":"0.0.0.0","port":1975},"grpcEndpoint":{"host":"35.197.127.151","port":1973},"grpcTimeout":5,"seedEndpoints":[{"host":"35.185.222.198","port":1973}],"delegateEndpoints":[{"host":"35.197.127.151","port":1973}],"useQuantumEntropy":false,"genesisTransaction":"{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"}
1 change: 1 addition & 0 deletions google-cloud-spawn-vms/tn-203/delegate-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"httpEndpoint":{"host":"0.0.0.0","port":1975},"grpcEndpoint":{"host":"35.230.106.167","port":1973},"grpcTimeout":5,"seedEndpoints":[{"host":"35.185.222.198","port":1973}],"delegateEndpoints":[{"host":"35.230.106.167","port":1973}],"useQuantumEntropy":false,"genesisTransaction":"{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"}
1 change: 1 addition & 0 deletions google-cloud-spawn-vms/tn-203/delegate-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"httpEndpoint":{"host":"0.0.0.0","port":1975},"grpcEndpoint":{"host":"35.185.218.82","port":1973},"grpcTimeout":5,"seedEndpoints":[{"host":"35.185.222.198","port":1973}],"delegateEndpoints":[{"host":"35.185.218.82","port":1973}],"useQuantumEntropy":false,"genesisTransaction":"{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"}
1 change: 1 addition & 0 deletions google-cloud-spawn-vms/tn-203/delegate-4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"httpEndpoint":{"host":"0.0.0.0","port":1975},"grpcEndpoint":{"host":"35.227.182.49","port":1973},"grpcTimeout":5,"seedEndpoints":[{"host":"35.185.222.198","port":1973}],"delegateEndpoints":[{"host":"35.227.182.49","port":1973}],"useQuantumEntropy":false,"genesisTransaction":"{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"}
1 change: 1 addition & 0 deletions google-cloud-spawn-vms/tn-203/seed-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"httpEndpoint":{"host":"0.0.0.0","port":1975},"grpcEndpoint":{"host":"35.185.222.198","port":1973},"grpcTimeout":5,"seedEndpoints":[],"delegateEndpoints":[{"host":"35.185.222.198","port":1973}],"useQuantumEntropy":false,"genesisTransaction":"{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"}
37 changes: 37 additions & 0 deletions run-nodes-locally/delegate-1/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"httpEndpoint": {
"host": "0.0.0.0",
"port": 1175
},
"grpcEndpoint": {
"host": "127.0.0.1",
"port": 1173
},
"grpcTimeout": 5,
"seedEndpoints": [
{
"host": "127.0.0.1",
"port": 1973
}
],
"delegateEndpoints": [
{
"host": "127.0.0.1",
"port": 1173
},
{
"host": "127.0.0.1",
"port": 1273
},
{
"host": "127.0.0.1",
"port": 1373
},
{
"host": "127.0.0.1",
"port": 1473
}
],
"useQuantumEntropy": false,
"genesisTransaction": "{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"
}
37 changes: 37 additions & 0 deletions run-nodes-locally/delegate-2/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"httpEndpoint": {
"host": "0.0.0.0",
"port": 1275
},
"grpcEndpoint": {
"host": "127.0.0.1",
"port": 1273
},
"grpcTimeout": 5,
"seedEndpoints": [
{
"host": "127.0.0.1",
"port": 1973
}
],
"delegateEndpoints": [
{
"host": "127.0.0.1",
"port": 1173
},
{
"host": "127.0.0.1",
"port": 1273
},
{
"host": "127.0.0.1",
"port": 1373
},
{
"host": "127.0.0.1",
"port": 1473
}
],
"useQuantumEntropy": false,
"genesisTransaction": "{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"
}
37 changes: 37 additions & 0 deletions run-nodes-locally/delegate-3/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"httpEndpoint": {
"host": "0.0.0.0",
"port": 1375
},
"grpcEndpoint": {
"host": "127.0.0.1",
"port": 1373
},
"grpcTimeout": 5,
"seedEndpoints": [
{
"host": "127.0.0.1",
"port": 1973
}
],
"delegateEndpoints": [
{
"host": "127.0.0.1",
"port": 1173
},
{
"host": "127.0.0.1",
"port": 1273
},
{
"host": "127.0.0.1",
"port": 1373
},
{
"host": "127.0.0.1",
"port": 1473
}
],
"useQuantumEntropy": false,
"genesisTransaction": "{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"
}
37 changes: 37 additions & 0 deletions run-nodes-locally/delegate-4/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"httpEndpoint": {
"host": "0.0.0.0",
"port": 1475
},
"grpcEndpoint": {
"host": "127.0.0.1",
"port": 1473
},
"grpcTimeout": 5,
"seedEndpoints": [
{
"host": "127.0.0.1",
"port": 1973
}
],
"delegateEndpoints": [
{
"host": "127.0.0.1",
"port": 1173
},
{
"host": "127.0.0.1",
"port": 1273
},
{
"host": "127.0.0.1",
"port": 1373
},
{
"host": "127.0.0.1",
"port": 1473
}
],
"useQuantumEntropy": false,
"genesisTransaction": "{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"
}
32 changes: 32 additions & 0 deletions run-nodes-locally/seed/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"httpEndpoint": {
"host": "0.0.0.0",
"port": 1975
},
"grpcEndpoint": {
"host": "127.0.0.1",
"port": 1973
},
"grpcTimeout": 5,
"seedEndpoints": [],
"delegateEndpoints": [
{
"host": "127.0.0.1",
"port": 1173
},
{
"host": "127.0.0.1",
"port": 1273
},
{
"host": "127.0.0.1",
"port": 1373
},
{
"host": "127.0.0.1",
"port": 1473
}
],
"useQuantumEntropy": false,
"genesisTransaction": "{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"
}
66 changes: 66 additions & 0 deletions transactions/contracts/deploy-many.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package main

import (
"bytes"
"fmt"
"net/http"
"time"

"github.com/dispatchlabs/disgo/commons/types"
"github.com/dispatchlabs/disgo/commons/utils"
)

func main() {

var delay = 500 * time.Microsecond
var txCount = 1000
var endpoint = "http://35.185.222.198:1975/v1/transactions"

// var waitGroup sync.WaitGroup
// waitGroup.Add(txCount)

var startTime = time.Now()

for i := 1; i <= txCount; i++ {
// go func() {
time.Sleep(delay)

tx, _ := generateOneTx()
post1Tx(tx, endpoint)

// waitGroup.Done()
// }()
}

// waitGroup.Wait()

fmt.Println(fmt.Sprintf("TXes: %d, TOTAL Time: [%v] Nanoseconds", txCount, time.Since(startTime).Nanoseconds()))
}

func generateOneTx() (*types.Transaction, error) {
var privateKey = "0f86ea981203b26b5b8244c8f661e30e5104555068a4bd168d3e3015db9bb25a"
var from = "3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c"
var code = "608060405234801561001057600080fd5b506040805190810160405280600d81526020017f61616161616161616161616161000000000000000000000000000000000000008152506000908051906020019061005c9291906100f7565b50600060016000018190555060006001800160006101000a81548160ff02191690831515021790555060018060010160016101000a81548160ff021916908360ff1602179055506040805190810160405280600b81526020017f6262626262626262626262000000000000000000000000000000000000000000815250600160020190805190602001906100f19291906100f7565b5061019c565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061013857805160ff1916838001178555610166565b82800160010185558215610166579182015b8281111561016557825182559160200191906001019061014a565b5b5090506101739190610177565b5090565b61019991905b8082111561019557600081600090555060010161017d565b5090565b90565b610664806101ab6000396000f300608060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806333e538e91461007d57806334e45f531461010d5780633a458b1f1461017657806378d8866e1461022557806379af6473146102b5578063cb69e300146102cc575b600080fd5b34801561008957600080fd5b50610092610335565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100d25780820151818401526020810190506100b7565b50505050905090810190601f1680156100ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561011957600080fd5b50610174600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506103d7565b005b34801561018257600080fd5b5061018b6103f4565b60405180858152602001841515151581526020018360ff1660ff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156101e75780820151818401526020810190506101cc565b50505050905090810190601f1680156102145780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561023157600080fd5b5061023a6104c4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027a57808201518184015260208101905061025f565b50505050905090810190601f1680156102a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c157600080fd5b506102ca610562565b005b3480156102d857600080fd5b50610333600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610579565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103cd5780601f106103a2576101008083540402835291602001916103cd565b820191906000526020600020905b8154815290600101906020018083116103b057829003601f168201915b5050505050905090565b80600160020190805190602001906103f0929190610593565b5050565b60018060000154908060010160009054906101000a900460ff16908060010160019054906101000a900460ff1690806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b5050505050905084565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055a5780601f1061052f5761010080835404028352916020019161055a565b820191906000526020600020905b81548152906001019060200180831161053d57829003601f168201915b505050505081565b600160000160008154809291906001019190505550565b806000908051906020019061058f929190610593565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106105d457805160ff1916838001178555610602565b82800160010185558215610602579182015b828111156106015782518255916020019190600101906105e6565b5b50905061060f9190610613565b5090565b61063591905b80821115610631576000816000905550600101610619565b5090565b905600a165627a7a72305820f782ba3879cbbd0ec37bd4bbfbe885796488e7504e9b2f1f6817a4d3b8fdae460029"
var theTime = utils.ToMilliSeconds(time.Now())

return types.NewDeployContractTransaction(
privateKey,
from,
code,
theTime,
)
}

func post1Tx(tx *types.Transaction, endpoint string) {
data := new(bytes.Buffer)
data.WriteString(tx.String())

resp, _ := http.Post(
endpoint,
"application/json; charset=utf-8",
data,
)

// If NOT then this happens https://stackoverflow.com/questions/37454236/net-http-server-too-many-open-files-error
resp.Body.Close()
}