Code Monkey home page Code Monkey logo

Comments (2)

jserv avatar jserv commented on June 17, 2024

@wusyong, can you propose the expected modifications against existing codebase?

from iota-swarm-node.

wusyong avatar wusyong commented on June 17, 2024

Here is the modification. time_start_pow is moved inside the loop since every transactions in same bundle are expected to have different attachment timestamp. timestamp_lower_bound and timestamp_upper_bound are optional, even api call attachToTangle from IRI assign 0 and max value separately. So they are assigned same values here. Should I create a pull request?

Proposed method:

        # attachment_timestamp = time_start_pow
        time_start_pow = time.time()
        timestamp = TryteString.from_trits(
            trits_from_int(int(round(time_start_pow * 1000)), pad=27))
        tx_tryte = insert_to_trytes(2619, 2528, str(timestamp), tx_tryte)


        # timestamp_lower_bound = 0
        # timestamp_upper_bound = MAX_VALUE - 1
        timestamp_upper_bound = TryteString("MMMMMMMMM")
        tx_tryte = insert_to_trytes(2637, 2646, str(timestamp_upper_bound), tx_tryte)

https://github.com/wusyong/iota-swarm-node/blob/2f2f30e3ecadbebbacb3dfe1eeef7da21ce2effb/swarm_node.py#L129-L138

Edit: Don't know why code snippet doesn't work properly. So just put the code here directly.

from iota-swarm-node.

Related Issues (10)

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.