Coder Social home page Coder Social logo

ckb-fake-env's Introduction

ckb-fake-env

build

Now it's depend on modified ckb.

Because it need ckb export a function.

cargo build

run

It need only one arg.

It's the transaction hash. Without 0x prefix.

It will output some shell command and args for run.

$ RUST_BACKTRACE=full ./target/debug/ckb-fake-env cf3592e963d0c04e68a35841e0494026c36d1f9c010e99f9f40c0e024931b153
args for lock script:
input 0:
command need to run before:
rm -f data/cell_0
ln -s `pwd`/data/cell_0_1 `pwd`/data/cell_0
rm -f cell_field_0_0
ln -s `pwd`/data/cell_field_0_1_0 `pwd`/data/cell_field_0_0
rm -f cell_field_0_1
ln -s `pwd`/data/cell_field_0_1_1 `pwd`/data/cell_field_0_1
rm -f cell_field_0_2
ln -s `pwd`/data/cell_field_0_1_2 `pwd`/data/cell_field_0_2
rm -f cell_field_0_3
ln -s `pwd`/data/cell_field_0_1_3 `pwd`/data/cell_field_0_3
rm -f cell_field_0_4
ln -s `pwd`/data/cell_field_0_1_4 `pwd`/data/cell_field_0_4
rm -f cell_field_0_5
ln -s `pwd`/data/cell_field_0_1_5 `pwd`/data/cell_field_0_5
rm -f cell_field_0_6
ln -s `pwd`/data/cell_field_0_1_6 `pwd`/data/cell_field_0_6
rm -f data/input_field_0_0
ln -s `pwd`/data/input_field_0_1_0 `pwd`/data/input_field_0_0
rm -f data/input_field_0_1
ln -s `pwd`/data/input_field_0_1_1 `pwd`/data/input_field_0_1
args:
4a88cef22e4e71c48c40da51c1d6bd16daa97aa7 4a88cef22e4e71c48c40da51c1d6bd16daa97aa7 02ebb3bcef8da55dc9884fae227ef9784625dc81eafd46c564d1045c7fa1cd9fa3 3045022100e9d363c8f8d5d1213f350bc106612af4e332c962bc99ae388b40a1c461f7d8f002203884f41233d60886388f29e001b3db1f46b0676455f5af94b35a36fe312dfeb1
input 1:
command need to run before:
rm -f data/cell_0
ln -s `pwd`/data/cell_1_1 `pwd`/data/cell_0
rm -f cell_field_0_0
ln -s `pwd`/data/cell_field_1_1_0 `pwd`/data/cell_field_0_0
rm -f cell_field_0_1
ln -s `pwd`/data/cell_field_1_1_1 `pwd`/data/cell_field_0_1
rm -f cell_field_0_2
ln -s `pwd`/data/cell_field_1_1_2 `pwd`/data/cell_field_0_2
rm -f cell_field_0_3
ln -s `pwd`/data/cell_field_1_1_3 `pwd`/data/cell_field_0_3
rm -f cell_field_0_4
ln -s `pwd`/data/cell_field_1_1_4 `pwd`/data/cell_field_0_4
rm -f cell_field_0_5
ln -s `pwd`/data/cell_field_1_1_5 `pwd`/data/cell_field_0_5
rm -f cell_field_0_6
ln -s `pwd`/data/cell_field_1_1_6 `pwd`/data/cell_field_0_6
rm -f data/input_field_0_0
ln -s `pwd`/data/input_field_1_1_0 `pwd`/data/input_field_0_0
rm -f data/input_field_0_1
ln -s `pwd`/data/input_field_1_1_1 `pwd`/data/input_field_0_1
args:
a47f8029997fcc67aff87384daac404f39e31ceb 4a88cef22e4e71c48c40da51c1d6bd16daa97aa7 02ebb3bcef8da55dc9884fae227ef9784625dc81eafd46c564d1045c7fa1cd9fa3 3045022100e9d363c8f8d5d1213f350bc106612af4e332c962bc99ae388b40a1c461f7d8f002203884f41233d60886388f29e001b3db1f46b0676455f5af94b35a36fe312dfeb1
input 2:
command need to run before:
rm -f data/cell_0
ln -s `pwd`/data/cell_2_1 `pwd`/data/cell_0
rm -f cell_field_0_0
ln -s `pwd`/data/cell_field_2_1_0 `pwd`/data/cell_field_0_0
rm -f cell_field_0_1
ln -s `pwd`/data/cell_field_2_1_1 `pwd`/data/cell_field_0_1
rm -f cell_field_0_2
ln -s `pwd`/data/cell_field_2_1_2 `pwd`/data/cell_field_0_2
rm -f cell_field_0_3
ln -s `pwd`/data/cell_field_2_1_3 `pwd`/data/cell_field_0_3
rm -f cell_field_0_4
ln -s `pwd`/data/cell_field_2_1_4 `pwd`/data/cell_field_0_4
rm -f cell_field_0_5
ln -s `pwd`/data/cell_field_2_1_5 `pwd`/data/cell_field_0_5
rm -f cell_field_0_6
ln -s `pwd`/data/cell_field_2_1_6 `pwd`/data/cell_field_0_6
rm -f data/input_field_0_0
ln -s `pwd`/data/input_field_2_1_0 `pwd`/data/input_field_0_0
rm -f data/input_field_0_1
ln -s `pwd`/data/input_field_2_1_1 `pwd`/data/input_field_0_1
args:
96f4093cf179aaa369379402d74f70090fae11ec 4a88cef22e4e71c48c40da51c1d6bd16daa97aa7 02ebb3bcef8da55dc9884fae227ef9784625dc81eafd46c564d1045c7fa1cd9fa3 3045022100e9d363c8f8d5d1213f350bc106612af4e332c962bc99ae388b40a1c461f7d8f002203884f41233d60886388f29e001b3db1f46b0676455f5af94b35a36fe312dfeb1
args for type script:
output 0:
No type script!

depend

It depend on spike and pk.

You can get docker image include spike here.

Replace pk with this which add support for ckb vm syscall.

example

See example code here

Copy data folder to current dir.

# spike ./pk vote a47f8029997fcc67aff87384daac404f39e31ceb 4a88cef22e4e71c48c40da51c1d6bd16daa97aa7 02ebb3bcef8da55dc9884fae227ef9784625dc81eafd46c564d1045c7fa1cd9fa3 3045022100e9d363c8f8d5d1213f350bc106612af4e332c962bc99ae388b40a1c461f7d8f002203884f41233d60886388f29e001b3db1f46b0676455f5af94b35a36fe312dfeb1
bbl loader
debug: 02ebb3bcef8da55dc9884fae227ef9784625dc81eafd46c564d1045c7fa1cd9fa3
debug: 3045022100e9d363c8f8d5d1213f350bc106612af4e332c962bc99ae388b40a1c461f7d8f002203884f41233d60886388f29e001b3db1f46b0676455f5af94b35a36fe312dfeb1
debug: a47f8029997fcc67aff87384daac404f39e31ceb
debug: 4a88cef22e4e71c48c40da51c1d6bd16daa97aa7
debug: total 3 yes 2

The result and output will be same as run script in ckb.

ckb-fake-env's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.