Skip to content

Instantly share code, notes, and snippets.

@crossle
Last active July 26, 2019 07:00
Show Gist options
  • Select an option

  • Save crossle/787bf9e44d01ffa37c80403ba9d980e4 to your computer and use it in GitHub Desktop.

Select an option

Save crossle/787bf9e44d01ffa37c80403ba9d980e4 to your computer and use it in GitHub Desktop.

Revisions

  1. crossle revised this gist Jul 26, 2019. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions Mixin testnet
    Original file line number Diff line number Diff line change
    @@ -31,12 +31,12 @@ Example:
    "asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc",
    "inputs":[
    {
    "deposit":
    {"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27",
    "asset":"0xa974c709cfb4566686553a20790685a47aceaa33",
    "transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1000000",
    "index":0,
    "amount":"100.035"
    "deposit": {
    "chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27",
    "asset":"0xa974c709cfb4566686553a20790685a47aceaa33",
    "transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1000000",
    "index":0,
    "amount":"100.035"
    }
    }
    ],
  2. crossle revised this gist Jul 26, 2019. 1 changed file with 25 additions and 2 deletions.
    27 changes: 25 additions & 2 deletions Mixin testnet
    Original file line number Diff line number Diff line change
    @@ -25,12 +25,35 @@ spend key: 0f7c6d8861b1fcdb936a1fd80f3acab452bb02e676ceb1949314bda8b915a902
    Create a deposit transaction to account, MixinNetwork transaction like UTXO include inputs and outputs

    Example:
    {"version":1,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"deposit":{"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27","asset":"0xa974c709cfb4566686553a20790685a47aceaa33","transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1000000","index":0,"amount":"100.035"}}],"outputs":[{"type":0,"amount":"100.035","script":"fffe01","accounts":["XIN6zb31xAmmtiZfDoZwYxA39LvgzqKeJtT4X2D5gvFRbcmiucwg3Mz9HNAuBeTaiWGxvBtJZ7czi8CZWRdGEprDbYHYYfzc"]}]}

    {
    "version":1,
    "asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc",
    "inputs":[
    {
    "deposit":
    {"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27",
    "asset":"0xa974c709cfb4566686553a20790685a47aceaa33",
    "transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1000000",
    "index":0,
    "amount":"100.035"
    }
    }
    ],
    "outputs":[
    {
    "type":0,
    "amount":"100.035",
    "script":"fffe01",
    "accounts":["XIN6zb31xAmmtiZfDoZwYxA39LvgzqKeJtT4X2D5gvFRbcmiucwg3Mz9HNAuBeTaiWGxvBtJZ7czi8CZWRdGEprDbYHYYfzc"]
    }
    ]
    }

    Sign the deposit transaction get the hex string

    Example:
    ./mixin signrawtransaction -n localhost:8001 -key xx -raw 'xx'
    ./mixin signrawtransaction -n localhost:8001 -key xx -raw '{"version":1,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"deposit":{"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27","asset":"0xa974c709cfb4566686553a20790685a47aceaa33","transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1000000","index":0,"amount":"100.035"}}],"outputs":[{"type":0,"amount":"100.035","script":"fffe01","accounts":["XIN6zb31xAmmtiZfDoZwYxA39LvgzqKeJtT4X2D5gvFRbcmiucwg3Mz9HNAuBeTaiWGxvBtJZ7czi8CZWRdGEprDbYHYYfzc"]}]}'

    key is your address view append spend string
    raw is above transaction raw string
  3. crossle revised this gist Jul 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Mixin testnet
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    1. Mixin testnet run
    1. Mixin testnet launch

    $ ./mixin setuptestnet

  4. crossle revised this gist Jul 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Mixin testnet
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ Send raw transaction
    ./mixin sendrawtransaction -n localhost:8001 -raw xx


    4. Transfer transaction
    4. Transfer asset transaction

    Create raw transaction

  5. crossle created this gist Jul 25, 2019.
    75 changes: 75 additions & 0 deletions Mixin testnet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,75 @@
    1. Mixin testnet run

    $ ./mixin setuptestnet

    $ mixin kernel -dir /tmp/mixin-7001 -port 7001
    $ mixin kernel -dir /tmp/mixin-7002 -port 7002
    $ mixin kernel -dir /tmp/mixin-7003 -port 7003
    $ mixin kernel -dir /tmp/mixin-7004 -port 7004
    $ mixin kernel -dir /tmp/mixin-7005 -port 7005
    $ mixin kernel -dir /tmp/mixin-7006 -port 7006
    $ mixin kernel -dir /tmp/mixin-7007 -port 7007

    2. Create Mixin Mainnet address

    $ ./mixin createaddress

    Example:

    address: XIN6zb31xAmmtiZfDoZwYxA39LvgzqKeJtT4X2D5gvFRbcmiucwg3Mz9HNAuBeTaiWGxvBtJZ7czi8CZWRdGEprDbYHYYfzc
    view key: 2f5320933fce783f36bc3192a7110660fff2dee256b17229a076f2b325dbfe03
    spend key: 0f7c6d8861b1fcdb936a1fd80f3acab452bb02e676ceb1949314bda8b915a902

    3. Deposit asset

    Create a deposit transaction to account, MixinNetwork transaction like UTXO include inputs and outputs

    Example:
    {"version":1,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"deposit":{"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27","asset":"0xa974c709cfb4566686553a20790685a47aceaa33","transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1000000","index":0,"amount":"100.035"}}],"outputs":[{"type":0,"amount":"100.035","script":"fffe01","accounts":["XIN6zb31xAmmtiZfDoZwYxA39LvgzqKeJtT4X2D5gvFRbcmiucwg3Mz9HNAuBeTaiWGxvBtJZ7czi8CZWRdGEprDbYHYYfzc"]}]}

    Sign the deposit transaction get the hex string

    Example:
    ./mixin signrawtransaction -n localhost:8001 -key xx -raw 'xx'

    key is your address view append spend string
    raw is above transaction raw string

    Send raw transaction

    ./mixin sendrawtransaction -n localhost:8001 -raw xx


    4. Transfer transaction

    Create raw transaction

    {
    "version": 1,
    "asset": "a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc",
    "extra": "",
    "outputs": [
    {
    "type": 0,
    "amount": "115.06849309",
    "script": "fffe01",
    "accounts": [
    "XINPXu5NBXszhpZDRJ8iA26TbQ2oWTSq1tXqKKeVeYWgLSz8yXGTtVhMogynYytoMewYVFR541wauLhy1YV33zg445E49YA7"
    ]
    }
    ],
    "inputs": [
    {
    "hash": "20001842d6eff5129c11f7c053bf1209f0267bf223f1681c9cb9d19fc773a692",
    "index": 11
    }
    ]
    }

    Sign the raw transaction get hex string

    ./mixin signrawtransaction -n localhost:8001 -key xx -raw '{"version":1,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","extra":"","outputs":[{"type":0,"amount":"115.06849309","script":"fffe01fffe01","accounts":["XINPXu5NBXszhpZDRJ8iA26TbQ2oWTSq1tXqKKeVeYWgLSz8yXGTtVhMogynYytoMewYVFR541wauLhy1YV33zg445E49YA7"]}],"inputs":[{"hash":"20001842d6eff5129c11f7c053bf1209f0267bf223f1681c9cb9d19fc773a692","index":11}]}'

    Send raw transaction

    ./mixin sendrawtransaction -n localhost:8001 -raw xx